<?php

require_once '../../FormWriter.php';

# TODO: enforce authentication here

$cdindex = new CDIndex();

$list = array(
	# trick to force a LEFT OUTER JOIN
	# TODO: avoid this trick which is implementation-dependant:
	# there should be a way to select from inner or outer self-join
	'media'=> array(
		'.rel'     => 'P.!',
		'id'       => 'DO',
		'borrower' => '_B',
	),
	'borrower' => array(
		'.rel'     => '!',
		'nickname' => '_B',
		'fullname' => 'P.'
	)
);

$cdindex->print_page($cdindex->convert_qbe($list), array(
	'url'     => 'list.php',
	 # TODO: number of rows in the caption; caption for vert layout?
	'summary' => 'This table gives the numeric id, description and borrower (if any) for each media in the database.',
	'caption' => 'All media',
	'group'   => array(1, 2),
	'empty'   => 'There are no media yet.',
	'repeat'  => 0,
	'custom'  => array(
		'borrower' => 'echo $this->template("table/data", self::attr_quote($row[3]), $value);',
		'fullname' => NULL
	),
	'pager'   => 'both',
	'row_cnt' => 3,
	'uniq'    => 'id'
));

# End of file
# vim: set ts=2 sw=2 et:
?>
